package com.bifrost.model.option;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;

/**
 * @com.bifrost.model.option
 * @wechat-mall
 * @lee Create Class on 2018/4/16
 */
@Data
//@JsonInclude(JsonInclude.Include.NON_NULL)
public class OptionModel implements Serializable {


    private Long productOptionId;
    @NotBlank(message = "规格名称不能为空")
    private String attributeName;
    @JsonIgnore
    private int displayOrder=0;
    @Valid
    private List<OptionValueModel> optionValues;

    public OptionModel(Long productOptionId, String attributeName, List<OptionValueModel> optionValues) {
        this.productOptionId = productOptionId;
        this.attributeName = attributeName;
        this.optionValues = optionValues;
    }

    public OptionModel() {
    }
}
